home *** CD-ROM | disk | FTP | other *** search
/ CD School House 9 / CD School House 9.0 - Wayzata Technology (1994).iso / pc / dos / teachaid / par / pom.inf < prev    next >
Text File  |  1994-05-19  |  29KB  |  740 lines

  1.     ===========================================================================
  2.     ===========================================================================
  3.     ============================                   ============================
  4.     ============================                   ============================
  5.     ============================   PARSE-O-MATIC   ============================
  6.     ============================                   ============================
  7.     ============================                   ============================
  8.     ===========================================================================
  9.     ===========================================================================
  10.  
  11.  
  12.  
  13.  
  14.  
  15.                    Parse-O-Matic is Copyright (C) 1992, 1994
  16.  
  17.  
  18.                                        by
  19.  
  20.  
  21.          Pinnacle Software, CP 386 Mount Royal, Quebec, Canada H3P 3C6
  22.          U.S. Office: Box 714 Airport Road, Swanton, Vermont 05488 USA
  23.  
  24.          Support Line (514) 345-9578 --- Free Files BBS (514) 345-8654
  25.  
  26.  
  27.  
  28.  
  29.  
  30.          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  31.  
  32.          This is a SHAREWARE product.  That means we would like you to
  33.          pass around unregistered copies to other people.  If you have
  34.          a modem,  please  upload it  to your favourite bulletin board
  35.          system,  or give a copy to a friend whom you think might need
  36.          a program  like this.   Shareware means sharing!  Pass it on!
  37.  
  38.          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  39.  
  40.  
  41.  
  42.  
  43.  
  44.     ===========================================================================
  45.                                   INTRODUCTION
  46.     ===========================================================================
  47.  
  48.  
  49.                            --------------------------
  50.                            WHY YOU NEED PARSE-O-MATIC
  51.                            --------------------------
  52.  
  53.     There are plenty of programs out there that have valuable data locked away
  54.     inside them.  How do you get that data OUT of one program and into another
  55.     one?
  56.  
  57.     Some programs provide a feature which "exports" a file into some kind of
  58.     generic format.  Perhaps the most popular of these formats is known as a
  59.     "comma-delimited file", which is a text file in which each data field is
  60.     separated by a comma.  Literal strings -- which might themselves contain
  61.     commas -- are surrounded by double quotes.  So a few lines from a
  62.     comma-delimited file might look something like this (an export from a
  63.     hypothetical database of people who owe your company money):
  64.  
  65.      +--------------------------------------------------------------------+
  66.      |                                                                    |
  67.      |   "JONES","FRED","1234 GREEN AVENUE", "KANSAS CITY", "MO",293.64   |
  68.      |   "SMITH","JOHN","2343 OAK STREET","NEW YORK","NY",22.50           |
  69.      |   "WILLIAMS","JOSEPH","23 GARDEN CRESCENT","TORONTO","ON",16.99    |
  70.      |                                                                    |
  71.      +--------------------------------------------------------------------+
  72.  
  73.     Unfortunately, not all programs export or import data in this format.
  74.     Even more frustrating is a program that exports data in a format that is
  75.     ALMOST what you need!
  76.  
  77.     If that's the case, you might decide to spend a few hours in a text editor,
  78.     modifying the export file so that the other program can understand it.  Or
  79.     you might write a program to do the editing for you. Both solutions are
  80.     time-consuming.
  81.  
  82.     An even more challenging problem arises when a program which has no export
  83.     capability does have the ability to "print" reports to a file.  You can
  84.     write a program to read these files and convert them to something you can
  85.     use, but this can be a LOT of work!
  86.  
  87.  
  88.  
  89.                           ----------------------------
  90.                           PARSE-O-MATIC TO THE RESCUE!
  91.                           ----------------------------
  92.  
  93.     Parse-O-Matic is a utility that interprets text and fixed-length files and
  94.     converts them to other formats.  It can help you "boil down" reports into
  95.     their essential data.  You can also use it to convert NEARLY compatible
  96.     file formats.
  97.  
  98.  
  99.                                   ------------
  100.                                   HOW IT WORKS
  101.                                   ------------
  102.  
  103.     You need three things:
  104.  
  105.     1) The Parse-O-Matic program
  106.     2) A Parse-O-Matic "POM" file (to tell Parse-O-Matic what to do)
  107.     3) The input file
  108.  
  109.     The input file is usually a report from another program.  We've provided
  110.     several examples of typical input files.  For example, the file
  111.     EXAMPLE2.TXT comes from the AccPac accounting software.  AccPac is a great
  112.     program, but its export capabilities leave something to be desired.
  113.     Parse-O-Matic can help!
  114.  
  115.  
  116.  
  117.     ===========================================================================
  118.                                   FUNDAMENTALS
  119.     ===========================================================================
  120.    
  121.  
  122.     This documentation assumes that you are an experienced computer user.  If
  123.     you have trouble, you might ask a programmer to help you -- POM file
  124.     creation is a little like programming!
  125.  
  126.  
  127.  
  128.                            -------------------------
  129.                            THE PARSE-O-MATIC COMMAND
  130.                            -------------------------
  131.  
  132.     The format of the Parse-O-Matic command line is:
  133.  
  134.         POM pom-file input-file output-file
  135.  
  136.     Here's an example, as you would type it at the DOS command line:
  137.  
  138.         POM POMFILE.POM REPORT.TXT OUTPUT.TXT
  139.  
  140.     For a more formal description of the command line, start up POM by typing
  141.     this command at the DOS prompt:
  142.  
  143.         POM
  144.  
  145.                                   ------------
  146.                                   THE POM FILE
  147.                                   ------------
  148.  
  149.     The POM file is a text file with a .POM extension.  The following
  150.     conventions are used when interpreting the POM file:
  151.  
  152.     - Null lines and lines starting with a semi-colon (comments) are ignored.
  153.  
  154.     - A POM file may contain up to 500 lines of specifications.
  155.       Comment lines do not count in this total.
  156.  
  157.     A POM file contains no "loops" (to use the programming term).  Each line of
  158.     the input file is processed by the entire POM file.  If you'd like it
  159.     expressed in terms of programming languages, here's what POM does:
  160.  
  161.        +----------------------------------------------------------------+
  162.        | START: If there's nothing left in the input file, go to QUIT.  |
  163.        |        Read a line from the input file                         |
  164.        |        Do everything in the POM file                           |
  165.        |        Go to START                                             |
  166.        | QUIT:  Tell the user you're finished!                          |
  167.        +----------------------------------------------------------------+
  168.  
  169.  
  170.  
  171.                        ----------------------------------
  172.                        A CODING TIP:  PADDING FOR CLARITY
  173.                        ----------------------------------
  174.  
  175.     Spaces and tabs between the words and variables in a POM file line are
  176.     generally ignored (except in the case of the OUT and OUTEND commands).  You
  177.     can use spaces to make your POM files easier to read.
  178.  
  179.     Additionally, in any line in the POM file, the following terms are ignored:
  180.  
  181.         =   THEN   ELSE
  182.  
  183.     These can be added to make the lines easier to read.  For example, the IF
  184.     command can be written in any of the following ways:
  185.  
  186.         Very terse:          IF PRICE "0.00" BONUS "0.00" "1.00"
  187.  
  188.         Padded with spaces:  IF PRICE   "0.00"   BONUS   "0.00"   "1.00"
  189.  
  190.         Fully padded:        IF PRICE = "0.00" THEN BONUS = "0.00" ELSE "1.00"
  191.  
  192.  
  193.  
  194.     ===========================================================================
  195.                                  COMMAND WORDS
  196.     ===========================================================================
  197.  
  198.  
  199.     For ease of learning, the commands words are explained in the following
  200.     order:
  201.  
  202.     +-------------------------------------------------------------------------+
  203.     |                                                                         |
  204.     |      COMMANDS WHICH WILL...                 LIST OF COMMANDS            |
  205.     |      ----------------------------------     ----------------------      |
  206.     |      Break up an input line into fields     SET IF                      |
  207.     |      Generate output                        OUT OUTEND                  |
  208.     |      Accept or reject input                 MINLEN IGNORE ACCEPT        |
  209.     |      Alter fields                           TRIM PAD INSERT CHANGE      |
  210.     |      Preprocess input                       SPLIT CHOP                  |
  211.     |                                                                         |
  212.     +-------------------------------------------------------------------------+
  213.  
  214.  
  215.     Here is a quick-reference table of all the commands:
  216.  
  217.  
  218.     -------------------------------------------  ------------------------------
  219.     COMMAND FORMATS                              EXAMPLE
  220.     ===========================================  ==============================
  221.     SET     var1 value1                          SET     NAME $FLINE[20 26]
  222.     IF      value1 value2 var1 value3 [value4]   IF      X = "Y" THEN Z = "N"
  223.     -------------------------------------------  ------------------------------
  224.     OUT     value1 value2 |output-picture        OUT     "X" "X" |{PRICE}
  225.     OUTEND  value1 value2 |output-picture        OUTEND  "X" "X" |{$FLINE}
  226.     -------------------------------------------  ------------------------------
  227.     MINLEN  number                               MINLEN  "15"
  228.     IGNORE  value1 value2                        IGNORE  PRICE "0.00"
  229.     ACCEPT  value1 value2                        ACCEPT  $FLINE[1 3] "YES"
  230.     -------------------------------------------  ------------------------------
  231.     TRIM    var1 spec1 character                 TRIM    PRICE "R" "$"
  232.     PAD     var1 spec1 character len             PAD     SERIALNUM "L" "0" "10"
  233.     INSERT  var1 spec1 value1                    INSERT  PRICE "L" "$"
  234.     CHANGE  var1 value1 value2                   CHANGE  DATE "/" "-"
  235.     -------------------------------------------  ------------------------------
  236.     SPLIT   from to [,from to] [...]             SPLIT   1 250, 251 300
  237.     CHOP    from to [,from to] [...]             CHOP    1 250, 251 300
  238.     -------------------------------------------  ------------------------------
  239.  
  240.     The commands are explained in more detail (and in the same order) in the
  241.     following sections.
  242.  
  243.  
  244.  
  245.                                 ---------------
  246.                                 The SET Command
  247.                                 ---------------
  248.  
  249.  
  250.                             FORMAT:  SET var1 value1
  251.  
  252.  
  253.     SET assigns a value to a variable.  The usual reason to do this is to set a
  254.     variable from the input line (represented by the variable $FLINE) prior to
  255.     cleaning it up with TRIM. For example, if the input line looked like this:
  256.  
  257.         JOHN       SMITH     555-1234   322 Westchester Lane    Architect
  258.         |          |         |          |                       |
  259.         Column 1   Col 12    Col 22     Col 33                  Col 57
  260.  
  261.     then we could extract the last name from the input line with these two POM
  262.     commands:
  263.  
  264.         SET  NAME = $FLINE[12 21]      (Sets the variable from the input line)
  265.         TRIM NAME  "R"  " "            (Trims any spaces on the right side)
  266.  
  267.     SET would first set the variable NAME to this value:     "SMITH     "
  268.     After the TRIM, the variable NAME would have the value:  "SMITH"
  269.  
  270.     You will also use SET if you plan to include a substring of $FLINE in the
  271.     output, since the OUT and OUTEND commands do not recognize substrings after
  272.     the "|" marker, only complete variables.
  273.  
  274.  
  275.  
  276.                                  --------------
  277.                                  The IF Command
  278.                                  --------------
  279.  
  280.  
  281.                  FORMAT:  IF value1 value2 var1 value3 [value4]
  282.  
  283.  
  284.     If value1 contains value2, var1 is set to value3.  Otherwise, it is set to
  285.     value4.  If value4 is missing, nothing is done (i.e.  var1 is not changed).
  286.     Here's an example of the IF command...
  287.  
  288.         SET  EARNING = $FLINE[20 26]
  289.         TRIM EARNING  "A"  " "
  290.         IF   EARNING = "0.00" THEN BONUS = "0.00" ELSE "1.00"
  291.  
  292.     This would obtain the value between columns 20 and 26, remove any spaces,
  293.     then check if it equals "0.00".  If it does, the variable BONUS is set to
  294.     0.00.  If not, BONUS is set to "1.00".
  295.  
  296.  
  297.  
  298.                           ---------------------------
  299.                           The OUT and OUTEND Commands
  300.                           ---------------------------
  301.  
  302.  
  303.                 FORMAT:  OUT[END] value1 value2 |output-picture
  304.  
  305.  
  306.     The OUT command generates output without an end-of-line (i.e. carriage
  307.     return and linefeed characters).  The OUTEND command generates output and
  308.     also adds an end-of-line.
  309.  
  310.     When value1 matches value2, a line is output to the output file, according
  311.     to the output picture.  Within the output picture, all text is taken
  312.     literally (i.e.  " is taken to mean literally that -- a quotation mark
  313.     character).
  314.  
  315.     The only exception to this is variable names, which are identified by the
  316.     { and } characters.  For example, a POM file that contained the following
  317.     single line:
  318.  
  319.         OUTEND "X" = "X" |{$FLINE}
  320.  
  321.     would simply output every line from the input file (not very useful!).
  322.  
  323.     The "X" = "X" part of the command is the comparator which controls when
  324.     output occurs; if both parts of the comparator are both forced to the same
  325.     value, output will always occur.
  326.  
  327.     NOTE: For efficiency, OUT does not write immediately to the output file; it
  328.     accumulates the output until it reaches 255 characters before writing.  You
  329.     must do an OUTEND command to ensure that the data is actually written.  No
  330.     single OUT or OUTEND command can output more than 255 characters.
  331.  
  332.     You can not use substrings after the "|" marker.  Thus, the following line
  333.     is NOT legal:
  334.  
  335.         OUTEND $FLINE[1 3] = "IBM" |{$FLINE[1 15]}
  336.  
  337.     The correct way to code this is as follows:
  338.  
  339.         SET CODE = $FLINE[1 15]
  340.         OUTEND $FLINE[1 3] = "IBM" |{CODE}
  341.  
  342.     This would output the first 15 characters of any line that contains the
  343.     letters IBM in the first three positions.
  344.  
  345.  
  346.  
  347.                                ------------------
  348.                                The MINLEN Command
  349.                                ------------------
  350.  
  351.  
  352.                              FORMAT:  MINLEN number
  353.  
  354.  
  355.     MINLEN specifies the minimum length a line must be to be considered for
  356.     parsing.  If you omit the MINLEN command, the minimum length is assumed to
  357.     be 1.  That is to say, all lines longer than 1 character will be processed
  358.     and shorter lines (null lines in other words) will be ignored.
  359.  
  360.     MINLEN is useful for ignoring brief information lines that clutter up a
  361.     report that you are parsing.  For example, in the sample file EXAMPLE2.POM,
  362.     the MINLEN command is set to 85 to ensure that all lines shorter than 85
  363.     characters long will be ignored.  This simplifies the coding considerably.
  364.  
  365.     The longest allowable input line is 255 characters, unless you use the
  366.     SPLIT or CHOP command (described later).
  367.  
  368.  
  369.  
  370.                                ------------------
  371.                                The IGNORE Command
  372.                                ------------------
  373.  
  374.  
  375.                          FORMAT:  IGNORE value1 value2
  376.  
  377.  
  378.     When value1 contains value2, the input line is ignored and all further
  379.     processing on the input line stops.  The usual format of this command is as
  380.     in this example:
  381.  
  382.         IGNORE $FLINE[3 9] = "Date"
  383.  
  384.     This would skip any input line that contains the word "Date" between
  385.     columns 3 and 9 ($FLINE is the line just read from the input file).
  386.  
  387.  
  388.  
  389.                                ------------------
  390.                                The ACCEPT Command
  391.                                ------------------
  392.  
  393.  
  394.                          FORMAT:  ACCEPT value1 value2
  395.  
  396.  
  397.     The ACCEPT command accepts the input line if value1 contains value2.  For
  398.     example, if the entire POM file read as follows:
  399.  
  400.         ACCEPT $FLINE[15 17] = "YES"
  401.         OUTEND "X" = "X" |{$FLINE}
  402.  
  403.     then any input line that contains "YES" starting in column 15 would be sent
  404.     to the output file.  All other lines would be ignored.
  405.  
  406.     CLUSTERED ACCEPTS: Sometimes you have to check more than one value to see
  407.     if the input line is valid.  You do this by using "clustered ACCEPTs",
  408.     which are several ACCEPT commands in a row.
  409.  
  410.     Briefly stated, if you have several ACCEPTs in a row ("clustered"), they
  411.     are all processed to determine if the input line is acceptable or not.  If
  412.     even one ACCEPT matches up, the line is accepted.  To express this in more
  413.     detail...
  414.  
  415.     When value1 contains value2, the line is accepted, and processing of the
  416.     POM file continues for that input line, even if the immediately following
  417.     ACCEPTs do NOT produce a match.  After all, we've already got a match!
  418.  
  419.     If value1 does NOT contain value2, Parse-O-Matic looks at the next commmand
  420.     in the POM file.  If it is not another ACCEPT, the input line is ignored.
  421.     If it is another ACCEPT, maybe it will product a match! So Parse-O-Matic
  422.     moves to that command.
  423.  
  424.     The following POM file uses clustered ACCEPTs to accept any line that
  425.     contains the name "FRED" or "MARY" between columns 5 and 8, or contains the
  426.     word "MEMBER" between columns 20 and 25.
  427.  
  428.         SET    NAME = $FLINE[5 8]         (Set the variable)
  429.         ACCEPT NAME = "FRED"              (Look for FRED)
  430.         ACCEPT NAME = "MARY"              (Look for MARY)
  431.         ACCEPT $FLINE[20 25] = "MEMBER"   (Look for MEMBER)
  432.         OUTEND "X" = "X" |{$FLINE}        (Output the line if we get this far)
  433.  
  434.     The following example would NOT work, however:
  435.  
  436.         ACCEPT $FLINE[20 25] = "MEMBER"
  437.         SET    NAME = $FLINE[5 8]
  438.         ACCEPT NAME = "FRED"
  439.         ACCEPT NAME = "MARY"
  440.         OUTEND "X" = "X" |{$FLINE}
  441.  
  442.     It would not work because the ACCEPTs are not clustered; if the first
  443.     ACCEPT fails, the input line will be rejected as soon as the SET command is
  444.     encountered.  The next two ACCEPTs would not be reached in such case.
  445.  
  446.  
  447.  
  448.                                 ----------------
  449.                                 The TRIM Command
  450.                                 ----------------
  451.  
  452.  
  453.                        FORMAT:  TRIM var1 spec1 character
  454.  
  455.  
  456.     Removes characters from var1.  This is usually used to remove blanks.
  457.  
  458.     spec1 can be:  A=All   B=Both ends   L=Left side only   R = Right side only
  459.  
  460.     For example:
  461.  
  462.         SET  PRICE = $FLINE[20 26]
  463.         TRIM PRICE "A" ","
  464.         TRIM PRICE "L" "$"
  465.  
  466.     This would remove all commas from the variable "PRICE", and remove the
  467.     leading dollar sign.  Thus:
  468.  
  469.         If the input contained the string:   "$25,783"
  470.         The first TRIM would change it to:   "$25783"
  471.         The second TRIM would change it to:  "25783"
  472.  
  473.  
  474.  
  475.                                 ---------------
  476.                                 The PAD Command
  477.                                 ---------------
  478.  
  479.  
  480.                      FORMAT:  PAD var1 spec1 character len
  481.  
  482.  
  483.     PAD makes var1 a specified length, padded with a specified character.
  484.  
  485.         spec1      is "L", "R", or "C" (Left, Right or Center)
  486.         character  is the character used to pad the string
  487.         len        is the desired string length
  488.  
  489.     For example, if the variable ABC is set to "1234" ...
  490.  
  491.     PAD ABC "L" "0" "7"   left-pads it 7 characters wide with zeros ("0001234")
  492.     PAD ABC "R" " " "5"   right-pads it 5 characters wide with spaces ("1234 ")
  493.     PAD ABC "C" "*" "8"   would center it, 8 wide, with asterisks ("**1234**")
  494.  
  495.     If the length is less than the length of the string, it is unchanged.  For
  496.     example, if you set variable XYZ to "PINNACLE", then
  497.  
  498.         PAD XYZ "R" " " "3"
  499.  
  500.     would leave the string as-is ("PINNACLE").
  501.  
  502.     Thus, PAD can not be used to shorten a string.  If it was your intention to
  503.     make XYZ 3 letters long, it would be appropriate to use the SET command:
  504.  
  505.         SET XYZ = XYZ[1 3]
  506.  
  507.  
  508.                                ------------------
  509.                                The INSERT Command
  510.                                ------------------
  511.  
  512.  
  513.                        FORMAT:  INSERT var1 spec1 value1
  514.  
  515.  
  516.     The INSERT command inserts text on the left or right of var1, or at a
  517.     "found text" position.
  518.  
  519.         spec1  is "L" or "R" (Left or Right) or a find-string (e.g.  "@HELLO")
  520.         value1 is the value to be inserted
  521.  
  522.     For example, if the variable ABC is set to "ParseOMatic", then
  523.  
  524.         INSERT ABC "L" "Register "   would set ABC to "Register ParseOMatic"
  525.         INSERT ABC "R" " is super"   would set ABC to "ParseOMatic is super"
  526.  
  527.     You can use a find-string to insert text at the first occurance of the text
  528.     you specify.  For example:
  529.  
  530.         INSERT ABC "@OMatic" "-" would set ABC to "Parse-OMatic"
  531.  
  532.     If the find-string is not found, nothing is done.
  533.  
  534.  
  535.  
  536.                                ------------------
  537.                                The CHANGE Command
  538.                                ------------------
  539.  
  540.  
  541.                        FORMAT:  CHANGE var1 value1 value2
  542.  
  543.  
  544.     The CHANGE command replaces ALL occurances of value1 with value2.  This is
  545.     more powerful than TRIM, but is not as efficient.  Here is an example of
  546.     the CHANGE command in action:
  547.  
  548.         SET    DATE = $FLINE[31 38]
  549.         CHANGE DATE "/" "--"
  550.  
  551.     If the SET command assigned DATE the value:    "93/10/15"
  552.     Then the CHANGE command would convert it to:   "93--10--15"
  553.  
  554.  
  555.  
  556.                                -----------------
  557.                                The SPLIT Command
  558.                                -----------------
  559.  
  560.  
  561.      FORMAT:  SPLIT from-position to-position [,from-pos'n to-pos'n] [...]
  562.  
  563.  
  564.     The maximum length of an input line from a text file is 255 characters.  If
  565.     your input file is wider than that, you must break up the file into
  566.     manageable chunks, using the SPLIT command.  This command lets you specify
  567.     the way in which each input line is broken up so that it will look like
  568.     several SEPARATE lines.
  569.  
  570.     For example, if your input lines were up to 300 characters wide, you could
  571.     specify:
  572.  
  573.         SPLIT 1 255, 256 300
  574.  
  575.     This would break up each line as if it was two lines.  (If some of the
  576.     lines were less than 256 characters they would still be treated as two
  577.     lines, though the second line would be null (i.e.  empty).)
  578.  
  579.     You can specify up to 100 splits (use multiple SPLIT commands if
  580.     necessary).  With SPLIT, Parse-O-Matic can handle input records of up to
  581.     32767 characters.
  582.  
  583.  
  584.                                 ----------------
  585.                                 The CHOP Command
  586.                                 ----------------
  587.  
  588.  
  589.      FORMAT:  CHOP from-position to-position [,from-pos'n to-pos'n] [...]
  590.  
  591.  
  592.     The CHOP command works the same way as the SPLIT command, with one
  593.     exception:  it informs Parse-O-Matic that the input is a fixed-record-
  594.     length file. In other words, it means that the input records are
  595.     distinguished by having a particular (and exact) length, rather than being
  596.     separated by end-of-line characters (Carriage Return, Linefeed) as is the
  597.     case for a standard text file.
  598.  
  599.     Thus, if you have an input file containing fixed-length records, each of
  600.     which is 200 characters wide, you could specify it like this:
  601.  
  602.         CHOP 1 200
  603.  
  604.     If the input record is more than 255 characters, you must break it up into
  605.     smaller chunks.  For example, if the input record was 300 characters wide,
  606.     you could break it up like this:
  607.  
  608.         CHOP 1 250, 251 300
  609.  
  610.     By using CHOP, Parse-O-Matic can handle input records up to 32767
  611.     characters wide.
  612.  
  613.  
  614.  
  615.     ===========================================================================
  616.                               TERMS AND TECHNIQUES
  617.     ===========================================================================
  618.  
  619.  
  620.                                      ------
  621.                                      VALUES
  622.                                      ------
  623.  
  624.     A value can be specified in the following ways:
  625.  
  626.         "text"              A literal text string
  627.         VARNAME             The name of a variable
  628.         VARNAME[start end]  A substring of a variable
  629.         VARNAME[start]      A single character
  630.         VARNAME+            Incremented variable (see explanation below)
  631.  
  632.     Variable names can be up to 8 characters long.  There is no distinction
  633.     between upper and lower case in the variable name.  You can create up to
  634.     220 variables and literals.
  635.  
  636.     Parse-O-Matic predefines several variables.  They are:
  637.  
  638.         $FLINE = The line just read from the file (max. length 255 characters)
  639.         $FLUPC = The line just read from the file, in uppercase
  640.         $BRL = The { character (used in OUT)
  641.         $BRR = The } character (used in OUT)
  642.  
  643.     Since $FLINE has a maximum length of 255 characters, you will have to use
  644.     the SPLIT or CHOP command if your input file is wider than that.
  645.  
  646.  
  647.  
  648.                                    ----------
  649.                                    DELIMITERS
  650.                                    ----------
  651.  
  652.     If you need to specify a quotation mark, use "".  For example:
  653.  
  654.         IGNORE $FLINE = "He said ""Hello"" to me."
  655.  
  656.     This would ignore lines containing:  He said "Hello" to me.
  657.  
  658.  
  659.  
  660.                                ------------------
  661.                                ILLEGAL CHARACTERS
  662.                                ------------------
  663.  
  664.     No command can contain these ASCII characters:
  665.  
  666.         HEX   DECIMAL   NAME
  667.         ---   -------   --------------------
  668.         $00      0      NULL
  669.         $0A     10      LF (Linefeed)
  670.         $0D     13      CR (Carriage Return)
  671.  
  672.     Of course, LF and CR do appear at the very end of each line.
  673.  
  674.  
  675.  
  676.                                   ------------
  677.                                   INCREMENTING
  678.                                   ------------
  679.  
  680.     Only numeric incrementing is supported.  Attempting to increment another
  681.     type of variable will result in an error.
  682.  
  683.     - Incrementing "1" gives you "2"
  684.     - Incrementing "9" gives you "10"
  685.  
  686.     The first time a variable is referenced, it has a null value.  If you
  687.     increment this, it will be changed from "" (i.e.  null) to "1".
  688.  
  689.  
  690.  
  691.                                  -------------
  692.                                  LINE COUNTERS
  693.                                  -------------
  694.  
  695.     If your input record is divided over several lines (due to its original
  696.     format or perhaps because you used the SPLIT or CHOP command), it is
  697.     helpful to set up a line counter.  The following example would extract the
  698.     first six characters of the second line of input records that span three
  699.     lines (designated lines 0, 1 & 2):
  700.  
  701.         IF     LineCntr = "1" THEN MyField = $FLINE[1 6]
  702.         OUTEND LineCntr = "1" |{MyField}
  703.         IF     LineCntr = "2" THEN LineCntr = "" ELSE LineCntr+
  704.  
  705.  
  706.  
  707.                                     -------
  708.                                     TRACING
  709.                                     -------
  710.  
  711.     By setting the DOS variable POM to ALL, you can generate a trace file,
  712.     named POM.TRC.  This is helpful if you have trouble understanding why your
  713.     file isn't being parsed properly.  But be sure to test it with a SMALL
  714.     input file; the trace is quite detailed, and it can easily generate a huge
  715.     output file.
  716.  
  717.     To save space, you can specify a particular list of variables to be traced,
  718.     rather than tracing everything.  For example, to trace only the variable
  719.     PRICE, enter this DOS command:
  720.  
  721.         SET POM=PRICE
  722.  
  723.     To trace several variables, separate the variable names by slashes, as in
  724.     this example:
  725.  
  726.         SET POM=PRICE/BONUS/NAME
  727.  
  728.  
  729.                                     --------
  730.                                     EXAMPLES
  731.                                     --------
  732.  
  733.     Most of these techniques are demonstrated by the examples provided with the
  734.     standard Parse-O-Matic package.  To see these examples, switch to your
  735.     Parse-O-Matic directory and type START at the DOS prompt.
  736.  
  737.  
  738.  
  739.  
  740.